﻿using System;
using System.Web;
using System.Web.Mvc;
using Microsoft.Web.Helpers;
using FlickrNet;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Syndication;
using System.Web.Mvc.Html;
using System.Linq.Expressions;
using System.IO;
using System.Text;
using System.Xml;

namespace SisocanaFrontEnd.Helpers
{
    public static class LinkHelpers
    {
        public static MvcHtmlString LinkTo(this HtmlHelper helper, string Action)
        {
            string tit = System.Configuration.ConfigurationManager.AppSettings[Action.Trim()+"Title"];
            string act = System.Configuration.ConfigurationManager.AppSettings[Action.Trim() + "Action"];
            string cont = System.Configuration.ConfigurationManager.AppSettings[Action.Trim() + "Controler"];
            return helper.ActionLink(tit, act, cont);        
        }

        public static String UrlTo(this HtmlHelper helper, string Action)
        {
            string act = System.Configuration.ConfigurationManager.AppSettings[Action.Trim() + "Action"];
            string cont = System.Configuration.ConfigurationManager.AppSettings[Action.Trim() + "Controler"];
            return String.Format("{0}/{1}/{2}", HttpRuntime.AppDomainAppVirtualPath, cont, act);
        }
    }
}